package org.xg.study.boot.common.json;

import com.alibaba.fastjson.JSONObject;

/**
 * @description
 * @author cmg
 * @date 2021/7/23 16:04
 * @version 1.0
 **/
public class JsonHandler {
    public static <T>T convertToBean(String jsonStr, Class<T> cClass){
        return JSONObject.parseObject(jsonStr, cClass);
    }

    public static <T>JSONObject covertToObject(T obj){
        return (JSONObject)JSONObject.toJSON(obj);
    }
}
